package se.webbzon.boltzmann.input;

import se.webbzon.boltzmann.resource.Resources;
import se.webbzon.oschi01.resourceset.ResourceSet;
import se.webbzon.oschi01.textureset.Texture3D;

public class GamepadAxisInfo implements AxisInfo {
	
	// The name of this key
	private final String name;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public GamepadAxisInfo(boolean primary) {
		if (primary)
			name = "Primary Axis";
		else
			name = "Secondary Axis";
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public String getName() {
		return name;
	}

	@Override public ResourceSet<Texture3D> getTextureSet(double direction, double value) {
		if (direction <= Math.PI/4 || direction > 7*Math.PI/4)
			return Resources.getTextureSet("axis_right");
		else if (direction <= 3*Math.PI/4)
			return Resources.getTextureSet("axis_up");
		else if (direction <= 5*Math.PI/4)
			return Resources.getTextureSet("axis_left");
		else
			return Resources.getTextureSet("axis_down");
	}

}
